package com.st.controller;

import com.st.entity.ESAttractions;
import com.st.service.ISearchService;
import com.st.utils.PageResult;
import com.st.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private ISearchService iSearchService;
    @RequestMapping("/loadData")
    public Result loadData(){
        return iSearchService.loadData();
    }

    @RequestMapping("/attractions")
    public PageResult<ESAttractions> search(@RequestBody Map searchMap){
        return iSearchService.search(searchMap);
    }

}
